/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.edu.agh.student.logic.util;

import java.util.List;

import org.jbpm.api.ExecutionService;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessInstance;
import org.jbpm.api.RepositoryService;


/**
 *
 * @author janburkot
 */
public class ProcessInformationServiceImpl implements ProcessInformationService {

        public RepositoryService repositoryService;
        public ExecutionService executionService;

        public ProcessInformationServiceImpl(){
            System.out.println("ProcessInformationServiceImpl");
        }
        public List<ProcessDefinition> getAllProcessDefinitionKeys() {
            List<ProcessDefinition> l = repositoryService.createProcessDefinitionQuery().list();
            System.out.println("YYYYYYYYYYYYYYYYYYYYY");
            System.out.println(l);
            return l;
        }
        
        public List<ProcessInstance> getAllOpenExecutions() {
            List<ProcessInstance> l = executionService.createProcessInstanceQuery().list();
            System.out.println("YYYYYYYYYYYYYYYYYYYYY");
            System.out.println(l);
            return l;
        }

        public void setRepositoryService(RepositoryService repositoryService) {
                this.repositoryService = repositoryService;
        }

        public void setExecutionService(ExecutionService executionService) {
                this.executionService = executionService;
        }
        
        
}
